package com.tcd.explore.service.impl;

import com.tcd.explore.pojo.SurveyLossInfo;
import com.tcd.explore.mapper.SurveyLossInfoMapper;
import com.tcd.explore.service.SurveyLossInfoService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tcd.service.Claimmainservice;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 查勘定损信息表 服务实现类
 * </p>
 *
 * @author Jarle
 * @since 2021-05-25
 */
@Service
public class SurveyLossInfoServiceImpl extends ServiceImpl<SurveyLossInfoMapper, SurveyLossInfo> implements SurveyLossInfoService {
    @Autowired
    SurveyLossInfoMapper surveyLossInfoMapper;
    @Autowired
    Claimmainservice claimmainservice;

    @Override
    public boolean SurveyStatusEditstatus(String sid, String status) {
        return surveyLossInfoMapper.SurveyStatusEditstatus(sid, status);
    }

    @Override
    public boolean Surveyadd(SurveyLossInfo surveyLossInfo) {
        return surveyLossInfoMapper.Surveyadd(surveyLossInfo);
    }

    @Override
    public int Suryveycount(String claimmainid) {
        return surveyLossInfoMapper.Suryveycount(claimmainid);
    }

    @Override
    public List<SurveyLossInfo> Surveysplice(int page, int pagesize) {
        List<SurveyLossInfo> list = surveyLossInfoMapper.Surveysplice(page, pagesize);
        for (SurveyLossInfo surveyLossInfo : list) {
            surveyLossInfo.setClaim(claimmainservice.Clainmainone(surveyLossInfo.getClaimMainId() + ""));
        }
        return list;
    }

    @Override
    public SurveyLossInfo listsurvery(String claimMainid) {
        return surveyLossInfoMapper.listsurvery(claimMainid);
    }
}
